home *** CD-ROM | disk | FTP | other *** search
- Path: btree.is.brooktree.com!usenet
- From: sasha@brooktree.com (Alex Bakaev)
- Newsgroups: comp.lang.c++
- Subject: Re: (HUGE) Help! This bug is killing me! Anyone have any ideas?
- Date: Sun, 07 Jan 1996 23:11:19 GMT
- Organization: Brooktree Corporation
- Message-ID: <4cpjuc$qt8@btree.brooktree.com>
- References: <4cjmbt$gaf@maverick.tad.eds.com>
- NNTP-Posting-Host: komissar.is.brooktree.com
- X-Newsreader: Forte Free Agent v0.46
-
- fignet05.darrins@eds.com (Darrin Smith) wrote:
-
- >First off thanks for reading (sorry this is so HUGE) and helping me save my
- >sanity.
-
- >Now, the following program seems to work perfectly until the final statement,
- >at which time Win95 reports that an execution of an invalid instruction has
- >been attenmpted, and that the program will be terminated.
-
- >Well I've spent 3 days now trying to figure out what is wrong with this
- >thing, and I've finally decided to enlist YOUR help. I know that somewhere
- >core is getting clobbered, but where I cannot tell.
-
-
- Well, it seems very simple: you have a pointer detail you forgot to
- initialize by allocating memory for it.
- [deleted]
-
- > ccun_detail *detail;
- [deleted]
- > if(!bad)
- > found=fread(detail,sizeof(ccun_detail),1,infile);
- You are using uninitialized pointer in the line above
-
- [deleted]
-
-
- You would've caught this bug right away if you had _all_ compiler
- warnings enabled ( at least in Borland compiler ). That's how I found
- it.
-
- Good luck, alex
-
-
-